<script setup>
import Son1Com from './components/Son1Com.vue';
import Son2Com from './components/Son2Com.vue';
import { storeToRefs } from 'pinia';
import { useCounterStore } from '@/store/counter.js';
import { useChannelStore } from '@/store/channel.js';
const counterStore = useCounterStore();
const channelStore = useChannelStore();

const { count, msg } = storeToRefs(counterStore);

</script>

<template>
  <div>
    <h3>App.vue根组件 - {{ count }} - {{ msg }} </h3>
    <Son1Com></Son1Com>
    <Son2Com></Son2Com>
    <hr>
    <ul>
      <li v-for="(item, index) in channelStore.channelList" :key="index">
        {{ item.name }} - {{ item.id }}
      </li>
    </ul>
    <button @click="channelStore.setChannelList">获取频道数据</button>
  </div>
</template>

<style scoped>

</style>
